/**
 * 
 */
package com.example.rebbitmqdelayTest;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author yanglei 2018年1月15日
 */
@Mapper
public interface OrderTradeRecordMapper {
	@Delete(" delete from order_trade_record where id = #{id,jdbcType=INTEGER}  ")
	int deleteByPrimaryKey(Integer id);

	@Insert("insert into order_trade_record (id, customer_id, order_id,  price, status, create_time,  update_time)   values (#{id,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER}, #{orderId,jdbcType=INTEGER},   #{price,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},    #{updateTime,jdbcType=TIMESTAMP})  ")
	int insert(OrderTradeRecord record);
	/*
	 * @Insert() int insertSelective(OrderTradeRecord record);
	 */

	@Select("select * from order_trade_record where id = #{id,jdbcType=INTEGER}")
	OrderTradeRecord selectByPrimaryKey(Integer id);

	/*int updateByPrimaryKeySelective(OrderTradeRecord record);*/

	@Update(" update order_trade_record  set customer_id = #{customerId,jdbcType=INTEGER},  order_id = #{orderId,jdbcType=INTEGER},  price = #{price,jdbcType=DECIMAL},      status = #{status,jdbcType=INTEGER},       create_time = #{createTime,jdbcType=TIMESTAMP},   update_time = #{updateTime,jdbcType=TIMESTAMP}   where id = #{id,jdbcType=INTEGER}  ")
	int updateByPrimaryKey(OrderTradeRecord record);
}
